package ai.people.netmon.userconfig.service.handle;

import ai.people.netmon.framework.domain.userconfig.entity.UserCollectConfigAccount;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 说明
 *
 * @author zhenglin
 * @since 2022/3/25
 */
public class HandleUrlUtil {
    public final static Map<String, HandleUrlService> HANDLE_URL_SERVICE_MAP = new ConcurrentHashMap<>();

    public static void putService(String type, HandleUrlService service) {
        HANDLE_URL_SERVICE_MAP.put(type, service);
    }

    public static HandleUrlService getService(String type){
        return HANDLE_URL_SERVICE_MAP.getOrDefault(type, new HandleUrlService() {
            @Override
            public String handleUrl(UserCollectConfigAccount account) {
                return null;
            }
        });
    }

    
}
